package com.sdy.po;


public class SerialPO {

    private Integer id;
    private Integer companyId;       // 公司id
    private String serialNumber;     // 串口号
    private Integer baudRate;        // 波特率
    private Integer checkoutBit;     // 校验位
    private Integer dataBit;         // 数据位
    private Integer stopBit;         // 停止位
    private Integer parmId;         //监控的数据名
    private Parm parm;
    private Boolean isHandled;   //是否经过处理

    public SerialPO(Integer companyId, String serialNumber, Integer baudRate, Integer checkoutBit, Integer dataBit, Integer stopBit, Integer parmId, Boolean isHandled) {
        this.companyId = companyId;
        this.serialNumber = serialNumber;
        this.baudRate = baudRate;
        this.checkoutBit = checkoutBit;
        this.dataBit = dataBit;
        this.stopBit = stopBit;
        this.parmId = parmId;
        this.parm = parm;
        this.isHandled = isHandled;
    }

    public SerialPO(Integer id, Integer companyId, String serialNumber, Integer baudRate, Integer checkoutBit, Integer dataBit, Integer stopBit, Integer parmId, Parm parm, Boolean isHandled) {
        this.id = id;
        this.companyId = companyId;
        this.serialNumber = serialNumber;
        this.baudRate = baudRate;
        this.checkoutBit = checkoutBit;
        this.dataBit = dataBit;
        this.stopBit = stopBit;
        this.parmId = parmId;
        this.parm = parm;
        this.isHandled = isHandled;
    }

    public Integer getParmId() {
        return parmId;
    }

    public void setParmId(Integer parmId) {
        this.parmId = parmId;
    }

    public Parm getParm() {
        return parm;
    }

    public void setParm(Parm parm) {
        this.parm = parm;
    }

    @Override
    public String toString() {
        return "SerialPO{" +
                "id=" + id +
                ", companyId=" + companyId +
                ", serialNumber='" + serialNumber + '\'' +
                ", baudRate=" + baudRate +
                ", checkoutBit=" + checkoutBit +
                ", dataBit=" + dataBit +
                ", stopBit=" + stopBit +
                ", parmId=" + parmId +
                ", parm=" + parm +
                ", isHandled=" + isHandled +
                '}';
    }

    public void setBaudRate(Integer baudRate) {
        this.baudRate = baudRate;
    }

    public void setCheckoutBit(Integer checkoutBit) {
        this.checkoutBit = checkoutBit;
    }

    public void setDataBit(Integer dataBit) {
        this.dataBit = dataBit;
    }

    public void setStopBit(Integer stopBit) {
        this.stopBit = stopBit;
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCompanyId() {
        return companyId;
    }

    public void setCompanyId(Integer companyId) {
        this.companyId = companyId;
    }

    public SerialPO(Integer id, Integer companyId, String serialNumber, int baudRate, int checkoutBit, int dataBit, int stopBit, Integer parmId, Boolean isHandled) {
        this.id = id;
        this.companyId = companyId;
        this.serialNumber = serialNumber;
        this.baudRate = baudRate;
        this.checkoutBit = checkoutBit;
        this.dataBit = dataBit;
        this.stopBit = stopBit;
        this.parmId = parmId;
        this.isHandled = isHandled;
    }




    public Boolean getHandled() {
        return isHandled;
    }

    public void setHandled(Boolean handled) {
        isHandled = handled;
    }

    public SerialPO(String serialNumber, int baudRate, int checkoutBit, int dataBit, int stopBit, Integer parmId, Boolean isHandled) {
        this.serialNumber = serialNumber;
        this.baudRate = baudRate;
        this.checkoutBit = checkoutBit;
        this.dataBit = dataBit;
        this.stopBit = stopBit;
        this.parmId = parmId;
        this.isHandled = isHandled;
    }


    public SerialPO() {}

    /**
     * 构造方法
     * @param serialNumber    串口号
     * @param baudRate        波特率
     * @param checkoutBit    校验位
     * @param dataBit        数据位
     * @param stopBit        停止位
     */
    public SerialPO(String serialNumber, int baudRate, int checkoutBit, int dataBit, int stopBit) {
        this.serialNumber = serialNumber;
        this.baudRate = baudRate;
        this.checkoutBit = checkoutBit;
        this.dataBit = dataBit;
        this.stopBit = stopBit;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public void setSerialNumber(String serialNumber) {
        this.serialNumber = serialNumber;
    }

    public int getBaudRate() {
        return baudRate;
    }

    public void setBaudRate(int baudRate) {
        this.baudRate = baudRate;
    }

    public int getCheckoutBit() {
        return checkoutBit;
    }

    public void setCheckoutBit(int checkoutBit) {
        this.checkoutBit = checkoutBit;
    }

    public int getDataBit() {
        return dataBit;
    }

    public void setDataBit(int dataBit) {
        this.dataBit = dataBit;
    }

    public int getStopBit() {
        return stopBit;
    }

    public void setStopBit(int stopBit) {
        this.stopBit = stopBit;
    }
}
